package com.itheima.server.domain;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.ContentRowHeight;
import com.alibaba.excel.annotation.write.style.HeadRowHeight;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.itheima.common.core.domain.BaseEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;
import java.util.Date;

/**
 * 线索实体类
 * 对应数据库表: t_clue
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("hk_clue")
@ContentRowHeight(20)
@HeadRowHeight(25)
@ColumnWidth(20)
public class Clue extends BaseEntity {
    /** ID - 主键 */
    @TableId(value = "id", type = IdType.AUTO)
    @ExcelProperty(value = "ID", index = 0)
    private Integer id;

    /** 客户姓名 */
    @ExcelProperty(value = "客户姓名", index = 1)
    private String name;

    /** 电话 - 唯一索引 */
    @ExcelProperty(value = "电话(必填)", index = 2)
    private String phone;

    /** 渠道来源 */
    @ExcelProperty(value = "渠道来源(必填)", index = 3)
    private String channel;

    /** 活动Id */
    @ExcelProperty(value = "活动ID", index = 4)
    private Integer activityId;

    /** 活动名称 */
    @ExcelProperty(value = "活动名称", index = 5)
    private String activityName;

    /** 活动信息 */
    @ExcelProperty(value = "活动信息", index = 6)
    private String activityInfo;

    /** 性别 */
    @ExcelProperty(value = "性别", index = 7)
    private Integer sex;

    /** 年龄 */
    @ExcelProperty(value = "年龄", index = 8)
    private Integer age;

    /** 微信 */
    @ExcelProperty(value = "微信", index = 9)
    private String weixin;

    /** QQ */
    @ExcelProperty(value = "QQ", index = 10)
    private String qq;

    /** 线索状态 1：待跟进 2：待分配 */
    @ExcelProperty(value = "线索状态", index = 11)
    private String status;

    /** 分配者id */
    @ExcelProperty(value = "分配者ID", index = 12)
    private String assignBy;

    /** 分配时间 */
    @ExcelProperty(value = "分配时间", index = 13)
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date assignTime;

    /** 下次跟进时间 */
    @ExcelProperty(value = "下次跟进时间", index = 14)
    @DateTimeFormat("yyyy-MM-dd HH:mm")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    private LocalDateTime nextTime;

    /** 结束时间 */
    @ExcelProperty(value = "结束时间", index = 15)
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    private Date endTime;

    /** 所有者 */
    @ExcelProperty(value = "所有者", index = 16)
    private String owner;

    /** 所有时间 */
    @ExcelProperty(value = "所有时间", index = 17)
    @DateTimeFormat("yyyy-MM-dd HH:mm:ss")
    private Date ownerTime;

    /** 跟进失败次数 */
    @ExcelProperty(value = "跟进失败次数", index = 18)
    private Integer falseCount;

    /** 转移者 */
    @ExcelProperty(value = "转移者", index = 19)
    private String transfer;

    /** 线索等级 */
    @ExcelProperty(value = "线索等级", index = 20)
    private String level;

    /** 科目 */
    @ExcelProperty(value = "科目", index = 21)
    private String subject;

    /** 用户ID */
    @ExcelProperty(value = "用户ID", index = 22)
    private Integer userId;

    /** 失败原因 */
    @ExcelProperty(value = "失败原因", index = 23)
    private String falsereason;
}
